package com.nuoniu.sibanyun.entity.production;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * mrp运算记录
 * </p>
 *
 * @author 小啊刚
 * @since 2021-03-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ma_mrp_oper_record")
@ApiModel(value="ErpMrpRecord对象", description="mrp运算记录")
public class ErpMrpRecord extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "mrp编号")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "状态")
    @TableField("status")
    private Boolean status;

    @ApiModelProperty(value = "物料id")
    @TableField("inventory_id")
    private Integer inventoryId;

    @ApiModelProperty(value = "物料名称")
    @TableField("inventory_name")
    private String inventoryName;

    @ApiModelProperty(value = "物料编码")
    @TableField("inventory_code")
    private String inventoryCode;

    @ApiModelProperty(value = "规格型号")
    @TableField("inventory_specification")
    private String inventorySpecification;

    @ApiModelProperty(value = "运算日期")
    @TableField("create_date")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "bom版本号")
    @TableField("bom_version_code")
    private String bomVersionCode;

    @ApiModelProperty(value = "计量单位id")
    @TableField("unit_id")
    private Integer unitId;

    @ApiModelProperty(value = "计量单位")
    @TableField("unit_name")
    private String unitName;

    @ApiModelProperty(value = "运算数量")
    @TableField("operation_quantity")
    private BigDecimal operationQuantity;

    @ApiModelProperty(value = "子件bom")
    @TableField("bom_id")
    private Integer bomId;

    @ApiModelProperty(value = "单据明细id")
    @TableField("voucher_id")
    private Integer voucherId;

    @ApiModelProperty(value = "单据号")
    @TableField("voucher_code")
    private String voucherCode;

    @ApiModelProperty(value = "运算单据类型1:销售2:预测3:生产计划")
    @TableField("voucher_type")
    private Integer voucherType;

    @ApiModelProperty(value = "单据id")
    @TableField("order_id")
    private Integer orderId;

    @ApiModelProperty(value = "需求日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    @TableField("need_date")
    private LocalDate needDate;

    @ApiModelProperty(value = "开工日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    @TableField(exist = false)
    private LocalDate planBeginDate;

    @ApiModelProperty(value = "完工日期")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    @TableField(exist = false)
    private LocalDate planEndDate;
}
